﻿using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TianShu.AspNetCore.SignalR;

namespace Test.WebApi.Hubs
{
    public class TestHub:AbpHub
    {
        public override Task OnConnectedAsync()
        {
            return base.OnConnectedAsync();
        }
        public override Task OnDisconnectedAsync(Exception exception)
        {
            return base.OnDisconnectedAsync(exception);
        }
        public async Task SendMessage(string targetUserName, string message)
        {
            var currentUserName = CurrentUser.UserName; //Access to the current user info
            var txt = "MyText";

            // Call the broadcastMessage method to update clients.
            await Clients.All.SendAsync("broadcastMessage", targetUserName, message);
        }
    }
}
